From 85ae875dcbfcfa3fbdca857dc90467d39b9ff0c5 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Mon, 13 Sep 2010 18:20:22 +0200 Subject: [PATCH] [GdkWindowCache] Don't ignore the CompositeOverlayWindow Add the composite overlay window to the cache, as this can be a reasonable Xdnd proxy as well. This is only done when the screen is composited in order to avoid mapping the COW. We assume that the CM is using the COW (which is true for pretty much any CM currently in use). https://bugzilla.gnome.org/show_bug.cgi?id=601731 --- gdk/x11/gdkdnd-x11.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index fc946cb672..b5e595f8fa 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -537,6 +538,7 @@ gdk_window_cache_new (GdkScreen *screen) GdkWindow *root_window = gdk_screen_get_root_window (screen); GdkChildInfoX11 *children; guint nchildren, i; + Window cow; GdkWindowCache *result = g_new (GdkWindowCache, 1); @@ -585,6 +587,20 @@ gdk_window_cache_new (GdkScreen *screen) g_free (children); + /* + * Add the composite overlay window to the cache, as this can be a reasonable + * Xdnd proxy as well. + * This is only done when the screen is composited in order to avoid mapping + * the COW. We assume that the CM is using the COW (which is true for pretty + * much any CM currently in use). + */ + if (gdk_screen_is_composited (screen)) + { + cow = XCompositeGetOverlayWindow (xdisplay, GDK_WINDOW_XWINDOW (root_window)); + gdk_window_cache_add (result, cow, 0, 0, gdk_screen_get_width (screen), gdk_screen_get_height (screen), TRUE); + XCompositeReleaseOverlayWindow (xdisplay, GDK_WINDOW_XWINDOW (root_window)); + } + return result; } -- 2.30.2